package org.courierio.jeesite.test.handler;

import org.courierframework.core.handler.PaginationHandler;
import org.courierio.jeesite.bean.ProductType;
import org.courierio.jeesite.bean.User;
import org.courierio.jeesite.test.SpringJUnit4Tester;
import org.junit.Test;

import javax.annotation.Resource;

/**
 * @author long.shiyu
 * @since 1.7
 */
public class PaginationHandlerTester extends SpringJUnit4Tester {
    @Resource
    private PaginationHandler<User, Integer> userHandler;
    @Resource
    private PaginationHandler<ProductType, Integer> productTypeHandler;

    @Test
    public void testPersist() throws Exception {
        User user = new User();
        user.setUsername("pne2");
        user.setPassword("admin");
        userHandler.persist(user);
        ProductType type = new ProductType();
        type.setName("电动按摩棒子2");
        productTypeHandler.persist(type);
    }

}
